package io.gitee.hchaojie.day01;

public class DemoRandom {
    public static void main(String[] args) {
        double value = Math.random();   // [0, 1)
        
        System.out.println(value);

        // [0, 20)

        // 强制类型转换
        int value2 = (int) (Math.random() * 20);
        System.out.println(value2);

        // [5, 20]          [0, 15]
        int value3 = (int) (Math.random() * 16) + 5;
        
        System.out.println((int) (11 * 2.0));
    }
}
